fix(core): accept deprecated reference config key#31659
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Restores backward compatibility for the deprecated top-level config key reference (singular) after the rename to references (plural), ensuring older published binaries and existing user configs don’t hard-error while newer builds continue using the canonical references field.
Changes:
- Re-add deprecated
referenceto the v1 config schema and include it in v1 detection/migration. - Migrate
reference→referencesduring v1→v2 config migration and add regression tests for detection + migration. - Update repo
.opencode/opencode.jsoncand regenerate the JS SDK types to accept the deprecated key.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/sdk/js/src/v2/gen/types.gen.ts | Updates generated SDK config types to also accept deprecated reference. |
| packages/opencode/test/config/config.test.ts | Adds a test ensuring v1 schema validation accepts the deprecated reference key. |
| packages/core/test/config/config.test.ts | Adds v1 detection and migration coverage for reference → references. |
| packages/core/src/v1/config/migrate.ts | Treats reference as a v1-only key and coalesces into references during migration. |
| packages/core/src/v1/config/config.ts | Re-introduces reference in the v1 schema with a deprecated description. |
| .opencode/opencode.jsonc | Temporarily switches repo config to reference so release pipelines using older binaries can load it. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ShamirSecret
pushed a commit
to ShamirSecret/auto-code-machine
that referenced
this pull request
Jun 11, 2026
(cherry picked from commit 90fb32b)
isaacfinnegan
pushed a commit
to isaacfinnegan/whispercode
that referenced
this pull request
Jun 15, 2026
davidgut1982
pushed a commit
to davidgut1982/opencode
that referenced
this pull request
Jun 19, 2026
markjaquith
pushed a commit
to markjaquith/opencode
that referenced
this pull request
Jun 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The `release patch` run failed (https://github.com/anomalyco/opencode/actions/runs/27264318252): the changelog step installs the latest published opencode and runs it against this repo, and `.opencode/opencode.jsonc` on dev uses the new `references` key from #31601, which released builds reject:
Beyond CI, #31601 renamed `reference` → `references` and removed the old key from the schema entirely, so any existing user config with `reference` hard-errors on upgrade.
Fix
Restore the established deprecated-key pattern (same treatment as `autoshare`→`share` and `mode`→`agent`, which remain in the schema):
Verification
Follow-up worth considering separately: have the changelog step run the source build from the release commit instead of npm-latest, which removes this class of failure entirely.